import { Evaluate } from 'evaluate-model.js';
var evaluate = new Evaluate();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    evalArr:[],
    id:''
  
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.data.id = options.order_id;
    // this.data.shopId = options.shopId;
    // console.log(this.data.shopId)
    this._loadData(this.data.id);
  },
  _loadData:function(id){
    var that = this;
    evaluate.getEvaluateList(id,(res)=>{
     that.setData({
       evalArr:res.item
     })
     wx.setStorageSync('evalArr', this.data.evalArr);
    })
  },

  changeData:function(){
    this._loadData(this.data.id);
  },
  // 去评价
  toEvaluate: function (event) {
    var id = evaluate.getDataSet(event, 'id');
    var shopId = evaluate.getDataSet(event, 'shopid');
    wx.navigateTo({
      url: '../evaluate/evaluate?id=' + id + '&shopId=' + shopId
    });
  },

})